package cn.tedu.user.mapper;

import cn.tedu.user.domain.dto.Clientupdateparam;
import cn.tedu.user.domain.po.Client;
import cn.tedu.user.domain.vo.ClientVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
public interface ClientMapper {
    @Select("SELECT * FROM client WHERE name=#{name}")
    Client selectByname(String name);
    @Select("SELECT * FROM client WHERE email=#{email}")
    Client selectByemail(String email);
    @Select(("SELECT * FROM client WHERE phone_number=#{phoneNumber}"))
    Client selectByphoneNumber(String phoneNumber);
    void insert(Client client);
    @Update("UPDATE client SET password_hash=#{password} WHERE name=#{name} and phone_number=#{phoneNumber}")
    void updateClient(Clientupdateparam clientupdateparam);
    void deleteById(Long clientId);

}
